package com.situ.stmall.front.mapper;

import com.situ.stmall.front.entity.GoodsPic;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GoodsPicMapper {
//    /**
//     * 批量插入图片
//     * @param pics
//     * @return
//     */
//    @Insert({"<script>",
//            "insert into goods_pic",
//            "(url,goods_id)",
//            "value",
//            "<foreach collection='pics' item='pic' separator=','>",
//            "(#{pic.url},#{pic.goodsId})",
//            "</foreach>",
//            "</script>"
//    })
//    int insert(@Param("pics") List<GoodsPic> pics);
//
//    /**
//     * delete
//     * @param goodsId
//     * @return
//     */
//    @Delete("delete from goods_pic where goods_id = #{goodsId}")
//    int deleteByGoodsId(Integer goodsId);

    /**
     *
     * @param goodsId
     * @return
     */
    @Select("select * from goods_pic where goods_id = #{goodsId}")
    List<GoodsPic> selectByGoodsId(Integer goodsId);
}
